package com.mhh.selary.backend.dto.config;

import com.mhh.sdk.beans.dto.BaseDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author mhh
 * @date 2020-09-02 17:06:11
 */
@Getter
@Setter
@ApiModel("保存属性入参")
public class PropSaveDTO extends BaseDTO {

    @ApiModelProperty(value = "id(新建不传，修改必传)")
    private Long id;

    @ApiModelProperty(value = "环境id", required = true)
    @NotNull(message = "环境id不能为空")
    private Long envId;

    @ApiModelProperty(value = "属性组", required = true)
    @NotEmpty(message = "属性组不能为空")
    private String propGroup;

    @ApiModelProperty(value = "属性名称")
    @Length(max = 12, message = "属性名称不能超过12个字符")
    private String propName;

    @ApiModelProperty(value = "属性key")
    @Length(max = 32, message = "属性key不能超过32个字符")
    private String propKey;

    @ApiModelProperty(value = "属性value")
    @Length(max = 128, message = "属性value不能超过128个字符")
    private String propValue;
}
